<template>
	<view class="themItem">
		<view @click="pageGoing('/pages/classlist/classlist')" class="box" v-if="!isMore">
			<image :src="themeImage.picsrc" mode="aspectFill" class="pic"></image>
			<view class="mask">{{themeImage.mask}}</view>
			<view class="tab">{{themeImage.tab}}</view>
		</view>

		<view @click="tabbarPageGoIng('/pages/classify/classify')" class="box more" v-else>
			<image src="https://img.keaitupian.cn/newupload/05/1683621565610736.jpg" mode="aspectFill" class="pic">
			</image>
			<view class="mask">
				<uni-icons type="more" size="30" color="#fff"></uni-icons>
				<text class="text">更多</text>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		pageGoing,
		tabbarPageGoIng
	} from '../../utils/pageGoIng';

	defineProps({
		isMore: {
			type: Boolean,
			default: false
		},
		themeImage: {
			type: Object,
			default: {
				id: "10000",
				picsrc: "https://img.keaitupian.cn/newupload/05/1683621565610736.jpg",
				mask: "动漫人物",
				tab: "热门壁纸",
			}
		}
	})
</script>

<style lang="scss" scoped>
	.themItem {
		.box {
			position: relative;
			border-radius: 12rpx;
			overflow: hidden;
			height: 340rpx;

			.pic {
				height: 100%;
				width: 100%;
			}

			.mask {
				position: absolute;
				width: 100%;
				height: 70rpx;
				bottom: 0;
				text-align: center;
				line-height: 70rpx;
				color: #fff;
				background: rgba(0, 0, 0, 0.2);
				font-size: 24rpx;
				backdrop-filter: blur(12rpx); // 背景模糊
				font-weight: 600;

			}

			.tab {
				position: absolute;
				top: 0;
				background-color: rgba(250, 129, 90, 0.7);
				backdrop-filter: blur(12rpx);
				color: #fff;
				font-size: 22rpx;
				padding: 6rpx 14rpx;
				border-radius: 0 0 12rpx 0;
				transform: scale(0.8);
				transform-origin: left top;
			}
		}

		.box.more {
			.mask {
				height: 100%;
				width: 100%;
				display: flex;
				align-items: center;
				justify-content: center;
				flex-direction: column;

				.text {
					font-size: 26rpx;
				}
			}

		}
	}
</style>